﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace STS.Account
{
    public partial class profil : System.Web.UI.Page
    {
        baza db = new baza();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Main.idroli == 1)
            {
                Master.FindControl("NavigationMenu").Visible = false;
                Master.FindControl("NavigationMenuR").Visible = true;
            }
            if (Main.idroli == 3)
            {
                Master.FindControl("NavigationMenu").Visible = true;
                Master.FindControl("NavigationMenuR").Visible = false;
                Master.FindControl("NavigationMenu0").Visible = false;
            }
            if (Main.idroli == 4)
            {
                Master.FindControl("NavigationMenu").Visible = false;
                Master.FindControl("NavigationMenuR").Visible = false;
                Master.FindControl("NavigationMenu0").Visible = true;
            }

           
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var ud = db.login_passes.SingleOrDefault(fbu => fbu.id == Main.id);
            //Response.Write(" \n" + ud);
            if (ud != null)
            {
                ud.password = Crypto.Encrypt(TextBox1.Text);
                db.SubmitChanges();
            }
           
        }
    }
}